
require('module-alias/register');
process.env.NODE_ENV = 'server';
const server = require('@tunnel-server/server.js');
const log = require('book');
const Debug = require('debug');
const debug = Debug('localtunnel');

const config = require('config');

const domain = config.get('domain');
const port = config.get('port');

const app = server({
    max_tcp_sockets: 1000,
    secure: false,
    domain: domain,
});

app.listen('3000', '0.0.0.0', (err) => {
  if (err) {
    console.error('port in used', err.msg);
    process.exit();
  }

  debug('server listening on port: %d', app.address().port);
});
